﻿Imports DataAcessLayer
Imports ZakaFrontEnd
Imports BusinessLogic

Partial Public Class ZakaPessoal
    Inherits System.Web.UI.Page

    Dim DAL As New DAL
    Dim BL As New BL
    Dim IDUtilizador = DAL.ObterUserIDPorNome(User.Identity.Name).FirstOrDefault.IDUser

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Dim rank = DAL.ObterRankPorUserSP(IDUtilizador).FirstOrDefault

        Dim yValues As Integer() = {rank.Golos_Marcados, rank.Vitorias, rank.Empates, rank.Derrotas, rank.Golos_Sofridos, rank.MVP}
        Dim xValues As String() = {"Golos Marcados", "Vitorias", "Empates", "Derrotas", "Golos Sofridos", "MVP"}

        'Chart1.Series("Series1").Points.DataBindXY(xValues, yValues)

    End Sub

    Protected Sub btnAlterarPass_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAlterarPass.Click

        If BL.AlterarPass(txtPassAntiga.Text, txtNovaPass.Text, IDUtilizador) Then

            lblMensagem.Text = "Password Alterada com Sucesso!"

        Else

            lblMensagem.Text = "Ocorreu um erro!"
        End If

    End Sub

    Protected Sub lnkVerGrafico_Click(ByVal sender As Object, ByVal e As EventArgs) Handles lnkVerGrafico.Click

        Select Case grafico.Visible

            Case False
                grafico.Visible = True

            Case Else
                grafico.Visible = False

        End Select

    End Sub

End Class